package com.zyh.dao;

import com.zyh.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;


@Mapper
@Repository
public interface UserDao {
    @Select("Select * from user where username=#{username}")
    User findByName(String username);

    @Insert("insert into user(username,password,salt) value(#{arg0},#{arg1},#{arg2})")
    void save(String username,String password,String salt);

    @Select("select * from user  where id=#{id}")
    User findById(Integer id);
    @Select("select * from user")
    List<User> findAllUserName();
}
